package com.fuyao.cloud.asset.dto;

import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.annotation.*;
import com.fuyao.cloud.asset.dto.ac.AssetAcCreateDTO;
import com.fuyao.cloud.common.core.util.DictItemOption;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.apache.commons.compress.utils.Lists;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author lyhills
 * @Description
 * @date 2023/5/26 10:09
 * @Version 1.0
 */
@Data
@ApiModel(value = " 资产信息管理创建DTO")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AssetCardCreateDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键Id")
    private Long id;

    @ApiModelProperty(value = "单位、部门ID")
    private Long deptId;

    @ApiModelProperty(value = "部门全名称")
    private String deptFullname;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "创建人ID")
    private Long createId;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "唯一编码（用于关联附件）")
    private String unid;

    @ApiModelProperty(value = "所属父类资产ID")
    private Long parentId;

    @ApiModelProperty(value = "所属父类资产名称")
    private String parentName;

    @ApiModelProperty(value = "资产编号")
    private String parentNumber;

    @ApiModelProperty(value = "使用单位全名称")
    private String parentUseunitname;

    @ApiModelProperty(value = "存放地全称")
    private String parentStorageplace;

    @ApiModelProperty(value = "标准型号名称")
    private String sauName;

    @ApiModelProperty(value = "标准型号ID")
    private Long sauId;

    @ApiModelProperty(value = "资产类别ID")
    private Long ctiId;

    @ApiModelProperty(value = "资产类别名称")
    private String ctiName;

    @ApiModelProperty(value = "资产类别类型")
    private String ctiType;

    @ApiModelProperty(value = "资产类别全名称")
    private String classified;

    @ApiModelProperty(value = "资产类别全编码")
    private String classifiedCode;

    /**
     * 按照编码规则如果没填就自动生成（编码规则是资产一级分类的编码加上年度月度在加5位唯一码），如果填了就按客户填写的，前端做校验只能是数字和字母不能的汉子和特殊符号
     */
    @ApiModelProperty(value = "资产编码")
    private String number;

    @ApiModelProperty(value = "资产名称")
    private String name;

    @ApiModelProperty(value = "英文名称")
    private String enName;

    @ApiModelProperty(value = "资产别名")
    private String alias;

    @ApiModelProperty(value = "规格型号")
    private String model;

    @ApiModelProperty(value = "计量单位")
    private String unit;

    @ApiModelProperty(value = "SN号")
    private String sn;

    @ApiModelProperty(value = "会计凭证号")
    private String voucherNo;

    @ApiModelProperty(value = "所属单位")
    private String belongdept;

    @ApiModelProperty(value = "所属单位全名称")
    private String belongdeptFullname;

    @ApiModelProperty(value = "所属单位id")
    private Long belongdeptId;

    @ApiModelProperty(value = "使用单位")
    private String usedept;

    @ApiModelProperty(value = "使用单位全名称")
    private String usedeptFullname;

    @ApiModelProperty(value = "使用单位id")
    private Long usedeptId;

    @ApiModelProperty(value = "使用人")
    private String useName;

    @ApiModelProperty(value = "使用人id")
    private Long useId;

    @ApiModelProperty(value = "存放地点")
    private String location;

    @ApiModelProperty(value = "存放地点id")
    private Long locationId;

    @ApiModelProperty(value = "存放地点类型")
    private String locationType;

    @ApiModelProperty(value = "房间ID")
    private Long houseId;

    @ApiModelProperty(value = "房间名称")
    private String houseName;

    /**
     * 来源默认为01{01：新购、02：调拨、03：接受捐赠、04：置换、05：自建、06：租赁、07：盘盈、08：其他}
     */
    @ApiModelProperty(value = "来源")
    private String source;

    @ApiModelProperty(value = "合 同 号")
    private String contractNumber;

    @ApiModelProperty(value = "合 同 ID")
    private Long contractId;

    @ApiModelProperty(value = "原    值")
    private BigDecimal originalAmount;

    @ApiModelProperty(value = "累计折旧")
    private BigDecimal depreciation;

    @ApiModelProperty(value = "金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "货币单位")
    private String monetaryUnit;

    /**
     * 默认为0{0：库存、1：在用、2：借用、3：维修中、4：调拨中、5：报废中、6：处置中、7：报废}
     */
    @ApiModelProperty(value = "资产状态")
    private String status;

    /**
     * 生 产 厂
     */
    @ApiModelProperty(value = "生 产 厂")
    private String maker;

    /**
     * 生 产 厂ID
     */
    @ApiModelProperty(value = "生 产 厂ID")
    private Long makerId;

    /**
     * 供 应 商
     */
    @ApiModelProperty(value = "供 应 商")
    private String supplier;

    /**
     * 供 应 商ID
     */
    @ApiModelProperty(value = "供 应 商ID")
    private Long supplierId;

    /**
     * 供应商联系人
     */
    @ApiModelProperty(value = "供应商联系人")
    private String supplierUser;

    /**
     * 供应商联系电话
     */
    @ApiModelProperty(value = "供应商联系电话")
    private String supplierPhone;

    /**
     * 品牌
     */
    @ApiModelProperty(value = "品牌")
    private String brand;

    /**
     * 维保到期
     */
    @ApiModelProperty(value = "维保到期")
    private LocalDate maintenanceDate;

    /**
     * 维保说明
     */
    @ApiModelProperty(value = "维保说明")
    private String maintenanceInfo;

    /**
     * 保修截止日期
     */
    @ApiModelProperty(value = "保修截止日期")
    private LocalDate guaranteeDate;

    /**
     * 出厂日期
     */
    @ApiModelProperty(value = "出厂日期")
    private LocalDate factoryDate;

    /**
     * 购入日期
     */
    @ApiModelProperty(value = "购入日期")
    private LocalDate buyDate;

    /**
     * 建档日期
     */
    @ApiModelProperty(value = "建档日期")
    private LocalDate recordDate;

    /**
     * 取得日期
     */
    @ApiModelProperty(value = "取得日期")
    private LocalDate acquireDate;

    /**
     * 始用日期
     */
    @ApiModelProperty(value = "始用日期")
    private LocalDate useDate;

    /**
     * 使用期限(月)
     */
    @ApiModelProperty(value = "使用期限(月)")
    private BigDecimal usefulLife;

    /**
     * 报废日期
     */
    @ApiModelProperty(value = "报废日期")
    private LocalDate scrapDate;

    /**
     * 经费来源
     */
    @ApiModelProperty(value = "经费来源")
    private String fundsSource;

    /**
     * 采购方式01：邀标、02：自采:03：政府采购
     */
    @ApiModelProperty(value = "采购方式")
    private String purchaseMode;

    /**
     * 固定资产0不是，1是，默认1
     */
    @ApiModelProperty(value = "固定资产")
    private String fixedAssets;

    /**
     * 取得方式
     */
    @ApiModelProperty(value = "取得方式")
    private String acquireWay;

    /**
     * 使用方式
     */
    @ApiModelProperty(value = "使用方式")
    private String usageOption;

    /**
     * 照片
     */
    @ApiModelProperty(value = "照片")
    private String photo;

    /**
     * 功能描述
     */
    @ApiModelProperty(value = "功能描述")
    private String description;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remarks;

    /**
     * 单价 用于属性复制
     */
    @ApiModelProperty(value = "单价")
    private BigDecimal price;

    public BigDecimal getPrice() {
        return this.amount;
    }

    @ApiModelProperty(value = "条型码")
    private String barcode;

    @ApiModelProperty(value="可选项对象")
    private DictOption dictOption;

    @Data
    public static class DictOption {

        @ApiModelProperty(value = "部门树集合")
        private List<Tree<Integer>> deptTreeList = Lists.newArrayList();

        @ApiModelProperty(value = "合同树集合")
        private List<Tree<Long>> contractTreeList = Lists.newArrayList();

        @ApiModelProperty(value = "供应商树集合")
        private List<Tree<Long>> vsupplierTreeList = Lists.newArrayList();

        @ApiModelProperty(value = "厂商树集合")
        private List<Tree<Long>> msupplierTreeList = Lists.newArrayList();

        @ApiModelProperty(value = "资产类别树集合")
        private List<Tree<Long>> ctiTreeList = Lists.newArrayList();

        @ApiModelProperty(value = "房间树集合")
        private List<Tree<Long>> houseTreeList = Lists.newArrayList();
    }
}
